package suzf.top.base.rx

import rx.Observable
import rx.functions.Func1
import suzf.top.base.data.protocol.BaseResp

/**
 *
 *========================
 * Created with AndroidStudio
 * Author:Mr.Su
 * Date:2019-09-09
 * Time:11:20
 * ========================
 */
class  BaseFuncBoolean<T>: Func1<BaseResp<T>,Observable<Boolean>> {

    override fun call(t: BaseResp<T>): Observable<Boolean> {
        if (t.status !=0) {
            return Observable.error(BaseException(t.status,t.message))
        }
        return Observable.just(true)
    }
}